import request from '@/utils/request'
export default {

  getList(currentPage,pageSize,goodsSearch) {
    return request({
      url: `/goods/search/${currentPage}/${pageSize}`,
      method: 'post',
      data:goodsSearch
    })
  },
  getType(){
    return request({
      url: `/goods/type`,
      method: 'get',
    })
  },
  add(goods,dynamicTags) {
    return request({
      url: `/goods/add/${dynamicTags}`,
      method: 'post',
      data:goods
    })
  },
  update(goods,dynamicTags) {
    return request({
      url: `/goods/edit/${dynamicTags}`,
      method: 'put',
      data:goods
    })
  },
  getById(id) {
    return request({
      url: `/goods/${id}`,
      method: 'get'
    })
  },
  delete(id) {
    return request({
      url: `/goods/${id}`,
      method: 'delete'
    })
  },
  addImgs(imgVo){
    return request({
      url: `/imgs`,
      method: 'post',
      data:imgVo
    })
  },
  editImgs(imgVo){
    return request({
      url: `/imgs`,
      method: 'put',
      data:imgVo
    })
  }
}
